package iit.projects.etaxi.model.entity;

import java.io.Serializable;

public class SubCityKey implements Serializable{
	
	private static final long serialVersionUID = -4276704880858179962L;

	private City city;
	
	private String code;
	
	public SubCityKey() {
	}

	public City getCity() {
		return city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getCity() == null) ? 0 : getCity().hashCode());
		result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SubCityKey other = (SubCityKey) obj;
		if (getCity() == null) {
			if (other.getCity() != null)
				return false;
		} else if (!getCity().equals(other.getCity()))
			return false;
		if (getCode() == null) {
			if (other.getCode() != null)
				return false;
		} else if (!getCode().equals(other.getCode()))
			return false;
		return true;
	}
	
	

}
